﻿<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm"> 
<div id="editcell"> 
	<div style="float:right;margin-bottom:10px;margin-top:-10px; clear:none">  
		<?php
		echo $this->lists['type'];
		echo $this->lists['chuyennganh'];
	?>
	</div>
	<div style="clear:both">
	</div>
    <table class="adminlist"> 
    <thead> 
        <tr> 
            <th width="100"> 
                <?php echo JText::_( 'Mã danh sách' ); ?> 
            </th> 
			<th> 
                <?php echo JText::_( 'Tên sinh viên' ); ?> 
            </th>  
			<th> 
                <?php echo JText::_( 'Nhóm' ); ?> 
            </th> 
			<th> 
                <?php echo JText::_( 'Ngành học' ); ?> 
            </th> 
			<th> 
                <?php echo JText::_( 'Chuyên ngành' ); ?> 
            </th> 
			<th width="20"> 
				<input type="checkbox" name="toggle" value="" 
				onclick="checkAll(<?php echo count( $this->items ); ?>);" /> 
			</th> 
        </tr>             
    </thead> 
    <?php 
    $k = 0; 
	$db=& JFactory::getDBO();
    for ($i=0, $n=count( $this->items ); $i < $n; $i++) 
    { 					
	        $row =& $this->items[$i]; 
			$checked    = JHTML::_( 'grid.id', $i, $row->mads ); 
			$link = JRoute::_( 'index.php?option=com_danhsach&controller=danhsach&task=edit&cid[]='. $row->mads ); 
        ?> 
        <tr class="<?php echo "row$k"; ?>"> 
            <td> 
                <a href="<?php echo $link; ?>"><?php echo $row->mads; ?></a>  
            </td> 
            <td> 
				
				<?php 
					$query = " Select * from #__sinh_vien where masv ='".$row->masv."'";
					$db->setQuery( $query );
					$data = $db->loadObject();
					echo $data->tensv; 
				?> 
            </td> 
			<td> 
				
				<?php 
					$query = " Select * from #__nhom_do_an where manhom ='".$row->manhom."'";
					$db->setQuery( $query );
					$data = $db->loadObject();
					echo $data->tennhom; 
				?> 
            </td>
			<td>
				<?php
					echo $data->manganh;
				?>
			</td>
			<td>
				<?php
					echo $data->tenchuyennganh;
				?>
			</td>
			<td> 
				<?php echo $checked; ?> 
			</td> 
        </tr> 
        <?php 
        $k = 1 - $k; 
    } 
    ?> 
	<tfoot>
    <tr>
      <td colspan="9"><?php echo $this->pagination->getListFooter(); ?></td>
    </tr>
  </tfoot>
    </table> 
</div> 
 
<input type="hidden" name="option" value="com_danhsach" /> 
<input type="hidden" name="task" value="" /> 
<input type="hidden" name="boxchecked" value="0" /> 
<input type="hidden" name="controller" value="danhsach" /> 
 
</form> 